package gov.nasa.anml.utility;

import java.util.Collection;
import java.util.Set;

import gov.nasa.anml.utility.iHashMap.Entry;

public interface pMap<V> {
	
	public static interface Entry<V> {
		public abstract V getValue();
		public abstract V setValue(V newValue);
	}

	/**
	 * @return the number of key-value mappings in this map
	 */
	public abstract int size();

	/**
	 * @return <tt>true</tt> if this map contains no key-value mappings
	 */
	public abstract boolean isEmpty();

	/**
	 * Removes all of the mappings from this map.
	 * The map will be empty after this call returns.
	 */
	public abstract void clear();

	public abstract boolean containsValue(V value);

	/** 
	 * Returns a deep-ish copy of this <tt>iHashMap</tt> instance;
	 * the values are not cloned, but the references are.
	 * 
	 * Changing a key-value mapping in a clone does not alter the original --
	 * but directly altering a value is reflected in all references to that
	 * value, e.g., in all clones. 
	 * 
	 * The keys are primitives and therefore copied.
	 *
	 * @return a shallow copy of this map
	 */
	public abstract pMap<V> clone();

	/**
	 * Returns a {@link Collection} view of the values contained in this map.
	 * The collection is backed by the map, so changes to the map are
	 * reflected in the collection, and vice-versa.  If the map is
	 * modified while an iteration over the collection is in progress
	 * (except through the iterator's own <tt>remove</tt> operation),
	 * the results of the iteration are undefined.  The collection
	 * supports element removal, which removes the corresponding
	 * mapping from the map, via the <tt>Iterator.remove</tt>,
	 * <tt>Collection.remove</tt>, <tt>removeAll</tt>,
	 * <tt>retainAll</tt> and <tt>clear</tt> operations.  It does not
	 * support the <tt>add</tt> or <tt>addAll</tt> operations.
	 */
	public abstract Collection<V> values();


}